<!--{template ADMIN_DIRECTORY/tpl/admin_header}-->
<div class="page_title">
    <h1>{$auth_item['auth_title']}{$_lang['edit']}</h1>
    <div class="tool">
        <a href="index.php?do=auth&view=item_list">{$_lang['auth_list']}</a>
        <a href="index.php?do=auth&view=item_edit&code={$code}" class="here">{$_lang['edit']}</a>
    </div>
</div>
<div class="box post">
    <div class="tabcon">
        <div class="title">
            <h2>{$_lang['edit_auth']}</h2>
        </div>
        <div class="detail">
            <form method="post" action="index.php?do={$do}&view={$view}&code={$code}"  enctype="multipart/form-data" name='authItemEdit' id='authItemEdit'>
                <input type="hidden" name="pk[auth_code]" value="{$code}">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th scope="row" width="130">
                            {$_lang['edit_auth_name']}
                        </th>
                        <td>
                            <input type="text" value="{$auth_item['auth_title']}" name="fds[auth_title]" id="title" class="txt" style=" width:260px;" limit="required:true;len:1-50" title="{lang:edit_auth_name_ttitle" msg="{$_lang['edit_auth_name_limits']}" msgArea="item_title_msg"/><b style="color:red">*</b>
                            <span id="item_title_msg"></span>
                        </td>
                    </tr>

                    <tr>
                        <th scope="row" width="130">{$_lang['workdays']}</th>
                        <td>
                            <input type="text" value="{$auth_item['auth_day']}" name="fds[auth_day]" id="auth_day" class="txt" style=" width:260px;" limit="required:true;len:1-50" title="{$_lang['workday_tips']}" msg="{$_lang['workday_limits']}" msgArea="link_name_msg"/><b style="color:red">*</b>
                            <span id="link_name_msg"></span><div class="padt10 direct"><p>（{$auth_item['auth_day']}{$_lang['workdays_complete']}）</p></div>
                        </td>
                    </tr>

            <!--   <tr>
                        <th scope="row" width="130">{$_lang['auth_cash']}</th><td>
                            <input type="text" value="{$auth_item['auth_cash']}" name="fds[auth_cash]" id="auth_cash" class="txt" style=" width:260px;">
                            <div class="padt10 direct"> <p>（{$_lang['null_and_free']}）</p></div>
                        </td>
                    </tr>-->

                    <tr>
                        <th scope="row" width="130">{$_lang['auth_period']}</th>
                        <td>
                            <input type="text" value="{$auth_item['auth_expir']}" name="fds[auth_expir]" id="auth_expir" class="txt" style=" width:260px;" limit="required:false;len:0-50" msg="{$_lang['auth_period_limits']}" msgArea="link_period_msg" /><b style="color:red">*</b>
                            <span id="link_period_msg"></span><div class="padt10 direct"><p>（{$_lang['auth_period_tips']}）</p></div>
                        </td>
                    </tr>
                    <tr>
                        <th scope="row" width="130">{$_lang['auth_big_icon']}</th>
                        <td>
						        <!--<input type="file" class="file" name="upload1" id="upload1">-->
								<div id="picker1">上传图片</div>
                                <div class="po_ab" style="left:130px;top:5px;">
                                    <span style="line-height:15px;" class="ws_prewrap mr_5">({$_lang['best_size']}50px*32px)</span>
                                </div>
								<div id="list1" class="affix-list upload-file-list-info" style="width:210px;"></div>
								
								 {if !empty($auth_item['big_info'])}
								 	{loop $auth_item['big_info'] $v}
									<ul class="upload-file-list-info">
										<li id="edit-{$v['file_id']}" class="affix-list-item" style="border: none;float: left;">
											<div class="upload-file-info">
													<span class="webuploader-pick-file-close" data-fileid="{$v['file_id']}" data-queued-id="edit-{$v['file_id']}" data-fileurl="<!--{eval echo imageClass::absUrl($v['save_name'])}-->">
														<i class="close"></i>
													</span>
													<span id="span_big_icon">
														<img id="imgPreview1" src="<!--{eval echo imageClass::absUrl($v['save_name'])}-->"  height="60px" width="60px" />
													</span>
											</div>
										</li>
									</ul>
									{/loop}
									{/if}
                                <input type="hidden" name="filepath1" id="filepath1" value="{$auth_item['big_info'][0]['save_name']}">
						</td>
                     </tr>
                    <tr>
                        <th scope="row" width="130">
                            {$_lang['auth_normal_icon']}
                        </th>
                        <td>
                        	<div style="width:200px;float:left;">
                                <!--<input type="file" class="file" name="upload2" id="upload2">-->
								<div id="picker2">上传图片</div>
                                <div class="po_ab" style="left:130px;top:5px;">
                                    <span style="line-height:15px;" class="ws_prewrap mr_5">(认证前{$_lang['best_size']}16px*16px)</span>
                                </div>
								<div id="list2" class="affix-list upload-file-list-info" style="width:210px;"></div>
								{if !empty($auth_item['small_n_info'])}
								 	{loop $auth_item['small_n_info'] $v}
									<ul class="upload-file-list-info">
										<li id="edit-{$v['file_id']}" class="affix-list-item" style="border: none;float: left;">
										  
											<div class="upload-file-info">
												
													<span class="webuploader-pick-file-close" data-fileid="{$v['file_id']}" data-queued-id="edit-{$v['file_id']}" data-fileurl="<!--{eval imageClass::absUrl($v['save_name'])}-->">
														<i class="close"></i>
													</span>
												
													<span id="span_big_icon">
													<img id="imgPreview2" src="<!--{eval echo imageClass::absUrl($v['save_name'])}-->" height="60px" width="60px" />
													</span>
											</div>
											
										</li>
									</ul>
									{/loop}
									{/if}
								
                                <input type="hidden" name="filepath2" id="filepath2" value="{$auth_item['small_n_info'][0]['save_name']}">
                            </div>

							<div style="width:200px;float:left;">

                                <!--<input type="file" class="file" name="upload3" id="upload3">-->
								<div id="picker3">上传图片</div>
                                <div class="po_ab" style="left:130px;top:5px;">
                                    <span style="line-height:15px;" class="ws_prewrap mr_5">(认证后{$_lang['best_size']}16px*16px)</span>
                                </div>
								<div id="list3" class="affix-list upload-file-list-info" style="width:210px;"></div>
								{if !empty($auth_item['small_info'])}
								 	{loop $auth_item['small_info'] $v}
									<ul class="upload-file-list-info">
										<li id="edit-{$v['file_id']}" class="affix-list-item" style="border: none;float: left;">
										  
											<div class="upload-file-info">
												
													<span class="webuploader-pick-file-close" data-fileid="{$v['file_id']}" data-queued-id="edit-{$v['file_id']}" data-fileurl="<!--{eval echo imageClass::absUrl($v['save_name'])}-->">
														<i class="close"></i>
													</span>
												
													<span id="span_big_icon">
														<img id="imgPreview3" src="<!--{eval echo imageClass::absUrl($v['save_name'])}-->" height="60px" width="60px" />
													</span>
											</div>
											
										</li>
									</ul>
									{/loop}
									{/if}
								
                                <input type="hidden" name="filepath3" id="filepath3" value="{$auth_item['small_info'][0]['save_name']}">
								</div>
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">{$_lang['auth_description']}</th>
                        <td><textarea rows="10" style="width:45%;" name="fds[auth_desc]">{$auth_item['auth_desc']}</textarea></td>
                    </tr>
                    <tr>
                        <th scope="row" width="130">
                            {$_lang['is_open']}
                        </th>
                        <td>
                            <p>
                                <label for="rdo_auth_open_1">
                                    <input type="radio" name="fds[auth_open]" value="1" id="rdo_auth_open_1" {if $auth_item['auth_open']}checked="checked"{/if}/> {$_lang['yes']}
                                </label>
                                <label for="rdo_auth_open_2">
                                    <input name="fds[auth_open]" type="radio" id="rdo_auth_open_2" value="0" {if !$auth_item['auth_open']}checked="checked"{/if} /> {$_lang['no']}
                                </label>
                            </p>
                        </td>
                    </tr>
					<tr>
                        <th scope="row" width="130">
                           {$_lang['order']}
                        </th>
                        <td>
                            <input type="text" value="{$auth_item['listorder']}" name="fds[listorder]" id="listorder" class="txt" style=" width:260px;" limit="required:true;type:int" title="{$_lang['input_serial_num']}" msg="{$_lang['serial_num_not_null']}" msgArea="link_listorder_msg"/>
                            <span id="link_listorder_msg"></span>
                            <div class="padt10 direct">
                                <p>
                                    （{$_lang['order_by_auth']}）
                                </p>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">
                            &nbsp;
                        </th>
                        <td>
                            <div class="clearfix padt10">
                                <button class="positive pill primary button" type="submit" name="sbt_edit"  onclick="return checkForm(document.getElementById('authItemEdit'));" value="{$_lang['submit']}">
                                    <span class="check icon"></span>{$_lang['submit']}
                                </button>
                            </div>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">

							



								var xyq = "<!--{eval echo $xyq = session_id();}-->";
					        </script>
				     <!--<script src="../static/js/uploadify/jquery.uploadify.min.js?r={RANDOM_PARA}" type="text/javascript"></script>
					 <link href="../static/js/uploadify/uploadify.css" rel="stylesheet">-->
					 <!--上传附件end-->

<script type="text/javascript">
/**
 * 上传完成后的页面响应
 * @param json json数据
 */

    function del(str,span){
		var value = $("#"+str).val().split("?")['0'];
		var fid=$("#"+str+"_fid").val();
    	var url  = '../index.php?do=ajax&view=file&ajax=del&filepath='+value+"&fid="+fid;
				$.post(url,function(json){
					if(json.status==1){
						 $("#"+str).val("delete");
						 $("#"+span).children().remove();
					}

				},'json');
		return false;
	}
</script>

<script type="text/javascript">
	var baseurl = "{$basic_config['website_url']}";
	var uploadsize = parseInt("{$basic_config['max_size']}");
		uploadsize =  isNaN(uploadsize)? 1 : uploadsize;
	$(function(){
		$("#picker1").KKUploader({
				accept: {
					extensions : 'jpg,jpeg,gif,png,bmp'
				},
				uploadEvents: {
					uploadComplete:function(file){
//						var url = $("#"+file.id).find('.webuploader-pick-file-close').attr('data-fileurl');
//        				$('#imgPreview1').removeClass('hidden');
//                      	$('#imgPreview1').attr('src','{REVIEW_BACKEND_PATH}'+url);
					}
				},
				fileNumLimit:1,
				fileSingleSizeLimit:uploadsize*1024*1024,
				listName:'list1',
				hiddenName:'filepath1',
				hiddenValType: 2
			},
			{
				fileType:'sys',
			  	objType:'tools',
				filename : 'file',
			});
			
		$("#picker2").KKUploader({
				accept: {
					extensions : 'jpg,jpeg,gif,png,bmp'
				},
				uploadEvents: {
					uploadComplete:function(file){
//						var url = $("#"+file.id).find('.webuploader-pick-file-close').attr('data-fileurl');
//        				$('#imgPreview2').removeClass('hidden');
//                      	$('#imgPreview2').attr('src','{REVIEW_BACKEND_PATH}'+url);
					}
				},
				fileNumLimit:1,
				fileSingleSizeLimit:uploadsize*1024*1024,
				listName:'list2',
				hiddenName:'filepath2',
				hiddenValType: 2
			},
			{
				fileType:'sys',
			  	objType:'tools',
				filename : 'file',
			});
			
		$("#picker3").KKUploader({
				accept: {
					extensions : 'jpg,jpeg,gif,png,bmp'
				},
				uploadEvents: {
					uploadComplete:function(file){
//						var url = $("#"+file.id).find('.webuploader-pick-file-close').attr('data-fileurl');
//        				$('#imgPreview3').removeClass('hidden');
//                      	$('#imgPreview3').attr('src','../'+url);
					}
				},
				fileNumLimit:1,
				fileSingleSizeLimit:uploadsize*1024*1024,
				listName:'list3',
				hiddenName:'filepath3',
				hiddenValType: 2
			},
			{
				fileType:'sys',
			  	objType:'tools',
				filename : 'file',
			});
	});

</script>
<link rel="stylesheet" type="text/css" href="tpl/js/webuploader/webuploader.css">
<script type="text/javascript" src="../static/js/jquery.min.js?r={RANDOM_PARA}"></script>
<script type="text/javascript" src="tpl/js/webuploader/webuploader.js?r={RANDOM_PARA}"></script>
<script type="text/javascript" src="tpl/js/webuploader/kppw.webuploader.js"></script>
<!--{template ADMIN_DIRECTORY/tpl/admin_footer}-->

<!--{template ADMIN_DIRECTORY/tpl/admin_footer}-->